//tohtml.js

var app = getApp()
Page({
	data: {
		root:'',
		siteroot:app.setting.siteroot,
		att_url:app.setting.att_url,
		syscolor:app.setting.syscolor,
		isnodata:false,
		account:app.setting.account,
		show_coupon:true,
		page:1,
		showgotop:true,
		pagetitle:'朋友圈' + '-' + app.setting.title,
		
	},
	onReady: function (){
	},
	onPullDownRefresh: function (){
		var the=this;
		var opt={};
		the.onLoad(opt);
		setTimeout(function(){
			wx.stopPullDownRefresh()
		},1000);
	},
	onLoad: function (opt){
		var page=this;
		if(opt){
			var pagetitle=opt.pagetitle?opt.pagetitle:page.data.pagetitle
			wx.setNavigationBarTitle({'title':pagetitle});
			page.setData({
				path:opt.path,
				pagetitle:pagetitle,
			});
		}
	},
	onShareAppMessage: function (res) {
		if (res.from === 'button') {
		  console.log(res.target)
		}
		var url = encodeURIComponent(this.data.url);
		return {
		  title: app.setting.title,
		  desc: app.setting.desc,
		  path: '/pages/html/html?url='+url,
		  success: function(res) {
		  },
		  fail: function(res) {
		  }
		}
	},
	onShareTimeline: function (res) {
		var the = this
		var pagedata = the.data.pagedata
		if (res.from === 'button') {
		}
		var path=the.data.route+'?'+app.access.query;
		var query=app.access.query
		if(app.access.op){
			path +='&op='+app.access.op;
			query +='&op='+app.access.op;
		}
		if(pagedata.fromuser){
			path +='&fromuser='+pagedata.fromuser;
			query +='&fromuser='+pagedata.fromuser;
		}
		return {
		  title: the.data.pagetitle,
		  query: query+'&isgoshare=true',
		  desc: app.setting.sharedesc,
		  success: function(res) {
		  },
		  fail: function(res) {
		  }
		}
	},
});